#ifndef DIALOG_LOGIN_H
#define DIALOG_LOGIN_H

#include <QDialog>

#include "loginUser.h"
#include "messageBox/messagebox.h"
#include "loginDB.h"

namespace Ui {
class Dialog_Login;
}

class Dialog_Login : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_Login(QWidget *parent = nullptr);
    ~Dialog_Login();

public:
    bool createUserDB();
    void userShow();

    LoginUser *getLoginUser() const;

    LoginDB *getLoginDB() const;

signals:
    void signalLoginPass();

private slots:
    void on_pushButton_login_clicked();
    void updateTopImage();

    void setTopImage(bool isSandom, int index_img);
    void setUserImage(bool isSandom, int index_img);
    int getImageIndex(bool isSandom, int index);
    bool login();

    void on_comboBox_user_name_currentIndexChanged(int index);
    
    void on_pushButton_user_config_clicked();

    void on_pushButton_passwd_change_clicked();



private:
    Ui::Dialog_Login *ui;
    MessageBox *box;
    LoginUser *loginUser;
    LoginDB *loginDB;
};

#endif // DIALOG_LOGIN_H
